import 'dart:math';

List<T> getRandomItems<T>(List<T> list, int count) {
  if (list.length <= count) {
    count = list.length;
  }
  List<T> shuffled = list.map((item) => item).toList();
  List<T> result = [];
  for (int i = 0; i < count; i++) {
    int index = Random().nextInt(shuffled.length);
    result.add(shuffled[index]);
    shuffled.removeAt(index);
  }
  return result;
}
